$(function($){
	$(document).on("click",".ajax-get",function(event){
		event.preventDefault();
		var target;
		var _this=$(this);

		try{
			if (_this.attr("func") != 'undefined') {
				var funcSuffix = 'ajaxGetBeforeCallback' + _this.attr("func");
				if (typeof(eval(funcSuffix)) == "function") {
					callback = eval(funcSuffix + "(obj)");
					if (!callback) {
						return false;
					}
				}
			}
		} catch (e) {}
		if ((target = _this.attr('href')) || (target = _this.attr('url'))) {
			$.get(target,function(data) {
				var callback = false;
				try{
					if (_this.attr("func") != 'undefined') {
						var funcSuffix = 'ajaxGetCallback' + _this.attr("func");
						if (typeof(eval(funcSuffix)) == "function") {
							callback = eval(funcSuffix + "(obj,data.code,data.msg)");
							if (!callback) {
								return false
							}
						}
					}
				} catch (e) {}
				if (data.code == 1) {
					if (data.url) {
						location.href = data.url
					} else {
						location.reload()
					}
				} else {
					mytips.error(data.msg,true,1000);
					setTimeout(function() {
						_this.removeClass('disable').attr('autocomplete', 'off').prop('disabled', false)
					},1000)
				}
			})
		}


		return false;
	});
	/*
		ajax提交表单（带表单验证功能）
	*/
	$('.js_form').Validform({tiptype:function(msg,o,cssctl){
		var objtip=$(".js_tipContent");
		if(msg){
			cssctl(objtip,o.type);
			objtip.text(msg);
		}else{
			objtip.removeClass('error success wait');
			objtip.text(msg);
		}
	},ajaxPost:true});
	/* validform封装 -E */
	
});